package com.alveole.events.server;

import java.util.List;

import com.alveole.tools.Logger;



public abstract class ServerEvents {

	public static String toJSON(List<ServerEvent> serverEvents)
	{
	  	String resp="";
	  	resp += ("{");
	  	resp += ("\"events\":");
	  	resp += ("[");
	  	for (int i=0; i<serverEvents.size() ;i++)
	  	{ //resp +="{\"command\":\"a\"}";
	  		resp += serverEvents.get(i).getJSON();
	  		if (i!=serverEvents.size()-1) resp += ",";
	  	}
	  	resp += ("]");
	  	resp+="}";
		Logger.log(Logger.USERRUN, " " + resp);
	  	
	  	return resp;
	}
}
